#include "Edgerunner.h"

#include <iostream>
#include <string>
#include <vector>
#include <queue>

using namespace std;

Edgerunner::Edgerunner(string name, int age){
    this->_name = name;
    this->_age = age;
}

void Edgerunner::pick_gun(Gun my_gun){
    this->_gun = my_gun;
    cout << "Incredible, it's " << this->_name;
    cout << ",a guy only " << this->_age << " years old." << endl;
    cout << "He picked up his gun." << endl;
    this->_gun.show_info();
}

void Edgerunner::load_bullet(int num){
    queue<int> bullet;
    while(num != 0 && bullet.size() < this->_gun.num_capacity()){
        bullet.push(num--);
    }
    int remain_cap = this->_gun.num_capacity()- bullet.size();
    switch(remain_cap){
    case 0:
        cout << "full of bullets" << endl;
        break;
    default:
        cout << "But there's not enough bullets" << endl;
    }
}

void Edgerunner::run(){
    cout << this->_name << " began to run" << endl;
}

void Edgerunner::biubiubiu(){
    this->_gun.biubiubiu();
}

void Edgerunner::legend(){
    vector<string> legend_people = {"silverhand", "V", "David"};

    cout << "he's dead, ";
    for(int i = 0 ; i < legend_people.size(); i++){
        if(this->_name == legend_people[i]){
            cout << "became a legend" << endl;
            return ;
        }
    }
    cout << "but he is still a nobody" << endl;
}